<?php 
require_once("Interfaces/Controllable.php");
class  Municipio implements Controllable{
    public $idMunicipio;
    public $codigo;
    public $municipio;
    function asControl($controlTag , $selected = false){
        return "<$controlTag value='$this->idMunicipio' ".($selected?" selected='selected' ":"").">$this->codigo - ".htmlspecialchars($this->municipio)."</$controlTag>";
    }
    function asOption($selected){
        return  ($this->asControl("OPTION", $selected));    
    }
    function asSpan(){
        return  ($this->asControl("SPAN"));    
    }
    public function __construct($idMunicipio , $codigo , $municipio) {
        $this->idMunicipio = $idMunicipio;
        $this->codigo = $codigo;
        $this->municipio = $municipio;
    }
    

}
?>